<!DOCTYPE html>
<html>

{include file='public/header'}

<body>
    <div class="x-nav">
        <span class="layui-breadcrumb">
            <a href="javascript:void(0)">首页</a>
            <a href="javascript:void(0)">报表管理</a>
            <a><cite>充值人均数据统计</cite></a>
        </span>
        <a class="layui-btn layui-btn-small" id="reload" title="刷新">
            <i class="layui-icon" style="line-height:30px"><i class="iconfont">&#xe6aa;</i></i>
        </a>
    </div>
    <div class="x-body">
        <div class="layui-row">
            <form class="layui-form">
                <div class="layui-inline">
                    <label class="layui-form-label w-auto">选择短剧：</label>
                    <div id="pMenu1" style="width:100%;flex:1"></div>
                </div>
                <button class="layui-btn" style="margin-left: 10px;" lay-submit lay-filter="searchList">搜索</button>
                <button type="reset" id="resetList" class="layui-btn layui-btn-primary">重置</button>
            </form>
        </div>
        <table id="perCapita" lay-filter="perCapita"></table>
    </div>
    <script>
        let params = {
                elem: '#perCapita'
                , toolbar:false
                , url: '/admin/video/getVideoPerCapita' //数据接口
                , id: 'perCapita'
                , page:true
                , limit:15
                , cols: [[ //表头
                    { field: 'video_id', title: '短剧ID', width:100, align:'center', }
                    , { field: 'video_name', title: '短剧名称', width:300, align:'center', }
                    , { field: 'recharge_template_name', width:300, title: '模板名称', align:'center', }
                    , { field: 'recharge_template_id', title: '模板ID', align:'center', }
                    , { field: 'recharge_template_type', title: '模板类型', align:'center', templet:function(d){
                        let name;
                        switch (d.recharge_template_type) {
                            case 1:
                                name = '低充'
                                break;
                            case 2:
                                name = '中充'
                                break;
                            case 3:
                                name = '高充'
                                break;
                        }
                        return name;
                    }}
                    , { field: 'per_capita', title: '人均贡献', align:'center', }
                    , { field: 'recharge_people_num', title: '充值人数', align:'center', }
                    , { field: 'recharge_price', title: '充值金额', align:'center', }
                ]],
            }
            tableList(params)

        let selectParams1 = {
            url: '/admin/video/select',
            selected: [],
            tips: '选择短剧',
            name: 'video_id',
            field_id: 'id',
            field_Name: 'name',
            elem: '#pMenu1'
        }
        selectN(selectParams1)

    </script>
</body>

</html>